// 递归判断对象属性是否为对象
function deepFreeze(obj) {
    if (typeof obj != 'object') {
        throw new Error('Type Error');
    }
    Object.freeze(obj);
    for (let key in obj) {
        if (obj.hasOwnPropery(key)) {
            if (typeof obj[key] === 'object') {
                deepFreeze(obj[key]);
            }
        }
    }
}
